import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { DropdownMenu, DropdownItem,Lazyload,Popover,NoticeBar,Image as VanImage,Area,Sticky,Tag,Notify,NavBar,Grid, GridItem,Tabbar, TabbarItem,Uploader,RadioGroup, Radio , Sidebar, SidebarItem,Col,Row, Divider, Popup, Overlay, Loading, Dialog, ContactCard, Form, AddressEdit, AddressList, Field, CellGroup, Cell, SwipeCell, Icon, Stepper, Card, Checkbox, CheckboxGroup, Button, Swipe, SwipeItem, PullRefresh, List, Tab, Tabs, SubmitBar, Toast, Skeleton } from 'vant'



import '@/assets/vantlessreset.less'; //vantui 样式覆盖
import '@/assets/base.scss' // global css
import './permission' // 全局路由跳转控制


Vue.use(Radio)
.use(Lazyload, {
  lazyComponent: true,
})
.use(DropdownMenu)
.use(DropdownItem)
.use(Popover)
.use(VanImage)
.use(NoticeBar)
.use(Area)
.use(Tag)
.use(Sticky)
.use(Notify)
.use(NavBar)
.use(Grid)
.use(GridItem)
.use(Tabbar)
.use(TabbarItem)
.use(Uploader)
.use(RadioGroup)
.use(Sidebar)
.use(SidebarItem)
.use(Col)
.use(Row)
  .use(Divider)
  .use(Popup)
  .use(Overlay)
  .use(Loading)
  .use(Dialog)
  .use(Toast)
  .use(ContactCard)
  .use(Form)
  .use(AddressEdit)
  .use(AddressList)
  .use(Field)
  .use(CellGroup)
  .use(Cell)
  .use(SwipeCell)
  .use(Icon)
  .use(Stepper)
  .use(Card)
  .use(Button)
  .use(Swipe)
  .use(SwipeItem)
  .use(PullRefresh)
  .use(List)
  .use(Tab)
  .use(Tabs)
  .use(SubmitBar)
  .use(Checkbox)
  .use(CheckboxGroup)
  .use(Skeleton)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

Date.prototype.Format = function (fmt) {
  var o = {
    "M+": this.getMonth() + 1, //月份   
    "d+": this.getDate(), //日   
    "h+": this.getHours(), //小时   
    "m+": this.getMinutes(), //分   
    "s+": this.getSeconds(), //秒   
    "q+": Math.floor((this.getMonth() + 3) / 3), //季度   
    "S": this.getMilliseconds() //毫秒   
  };
  if (/(y+)/.test(fmt))
    fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  for (var k in o)
    if (new RegExp("(" + k + ")").test(fmt))
      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  return fmt;
}